<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="http://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.0/axios.min.js"></script>
</head>

<body>
    <script>
        function ajax(url) {
            axios.get(url).then(res => userGen.next(res.data));
        }
        function* steps() {
            console.log('fetch users');
            const user = yield ajax('https://api.github.com/users');
            console.log(user);
            console.log('fetch firstUser');
            const firstUser = yield ajax(`https://api.github.com/users/${user[0].login}`);
            console.log(firstUser);
            console.log('fetch followers');
            const followers = yield ajax(firstUser.followers_url);
            console.log(followers);
        }

        const userGen = steps();
        userGen.next();
    </script>
</body>

</html>